package com.example.myrequestbody.model;

import com.example.myrequestbody.validator.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 用户
 *
 * @author dlp
 * @date 2024/08/27
 */
@Data
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 身份证件
     */
    private Long id;

    /**
     * 用户名
     */
    @NotNull(message = "数据验证失败，用户名不能为空！", groups = {UpdateGroup.class})
    private String userName;

    /**
     * 部门名称
     */
    @NotNull(message = "数据验证失败，部门名称不能为空！", groups = {UpdateGroup.class})
    private String deptName;

    /**
     * 角色列表
     */
    private List<String> roleList;

    @Override
    public String toString() {
        return "User{" +
                "userName='" + userName + '\'' +
                ", deptName='" + deptName + '\'' +
                ", roleList=" + roleList +
                '}';
    }
}
